<template>
	<view class="content">
		<!-- 这里是状态栏 -->
		<view class="status_bar"></view>
		<HeadCenter :webtext='webtext'></HeadCenter>
		<!-- 没数据展示的页面 -->
		<view class="bodyNone" v-if="list.length == 0">{{textLoding}}</view>
		<!-- 有数据的页面 -->
		<view class="body" v-if="list.length != 0">
			1111
		</view>
	</view>
</template>

<script>
	import HeadCenter from '../../components/headcenter.vue'
	export default {
		components:{  
			HeadCenter
		},
		data(){
			return{
				webtext:"优惠活动",
				textLoding:"数据加载中...",
				list:[]
			};
		},
		onLoad() {
			this.getlist()
		},
		methods:{
			// 优惠活动数据
			getlist(){
				this.$u.api.service({
					action: "GetAllEvents",
					terminal_id: 2,
					debug: false,
					lang: "zh",
				}).then(res => {
					this.list = res.data.list.data
					if(this.list.length == 0){
						this.textLoding = "没有更多数据了"
					}
					console.log(res.data.list.data,"优惠活动数据");
				})
			},
		}
	}
</script>

<style scoped>
	.bodyNone{
		height: calc(100vh - 88upx - var(--status-bar-height));
		overflow-y: auto;
		background: #f2f2f2;
		color: #333;
		line-height: 400upx;
		text-align: center;
		font-size: 34upx;
	}
	.body{
		height: calc(100vh - 88upx - var(--status-bar-height));
		overflow-y: auto;
		background: #f2f2f2;
	}
</style>
